package org.example.dev.learn.testbug;

import com.fasterxml.jackson.databind.ObjectMapper;

public class JacksonSerialTest {

    public static void main(String[] args) throws Exception{

        ObjectMapper mapper = new ObjectMapper();

        // JSON字符串，包含多态类型的信息
        String json = "{\"id\":1,\"name\":\"jackserial1\"}";

        JacksonSerial pojo = mapper.readValue(json, JacksonSerial.class);

        System.out.println("id: " + pojo.getId() + ", name: " + pojo.getName());
    }
}
